import ScrollPageList from "@/components/ScrollPageList";
import { Card, List } from "antd";
import { messageV1ControllerIndexMine } from "@/services/auto/message";
import { formatDateTime } from "common/utils/utils";

export default function (){

  return <Card>
    <ScrollPageList getScrollableTarget={()=>document.querySelector('#scroll-container')!} service={messageV1ControllerIndexMine} order={{
      orderBy: 'createTime',
      direction: 'DESC',
    }}>
      {(data)=>{
        return <List
          dataSource={data}
          renderItem={(item) => (
            <List.Item key={item.uuid}>
              <List.Item.Meta
                title={item.content}
                description={formatDateTime(item.createTime)}
              />
            </List.Item>
          )}
        />
      }}
    </ScrollPageList>
  </Card>
}
